﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace Calculator
{
    public partial class Calculator : Form
    {
        public Calculator()
        {
            InitializeComponent();
            Thread th = new Thread(new ThreadStart(tw));
            th.Start();
            
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void subtraction_Click(object sender, EventArgs e)
        {
            calculate('-');
        }

        private void division_Click(object sender, EventArgs e)
        {
            calculate('/');
        }

        private void equal_Click(object sender, EventArgs e)
        {
            equalClick();
        }

        private void point_Click(object sender, EventArgs e)
        {
            changeLabelText(".");
        }

        private void zero_Click(object sender, EventArgs e)
        {
            changeLabelText("0");
        }

        private void multiplication_Click(object sender, EventArgs e)
        {
            calculate('*');
        }

        private void two_Click(object sender, EventArgs e)
        {
            changeLabelText("2");
        }

        private void three_Click(object sender, EventArgs e)
        {
            changeLabelText("3");
        }

        private void one_Click(object sender, EventArgs e)
        {
            changeLabelText("1");
        }

        private void C_Click(object sender, EventArgs e)
        {
            clearLabelText();
        }

        private void four_Click(object sender, EventArgs e)
        {
            changeLabelText("4");
        }

        private void five_Click(object sender, EventArgs e)
        {
            changeLabelText("5");
        }

        private void six_Click(object sender, EventArgs e)
        {
            changeLabelText("6");
        }

        private void seven_Click(object sender, EventArgs e)
        {
            changeLabelText("7");
        }

        private void eight_Click(object sender, EventArgs e)
        {
            changeLabelText("8");
        }

        private void nine_Click(object sender, EventArgs e)
        {
            changeLabelText("9");
        }

        private void addition_Click(object sender, EventArgs e)
        {
            calculate('+');
        }
        
        private void backspace_Click(object sender, EventArgs e)
        {
            backspaceStart();
        }

        private void remainder_Click(object sender, EventArgs e)
        {
            calculate('%');
        }
    }
}
